/**
  grid-mask.h - Created by Timothy Morey on 6/1/2012
*/

#ifndef __GRID_MASK_H
#define __GRID_MASK_H

#include <libxml/tree.h>

#include "data-schema.h"
#include "frame-buffer.h"
#include "libnvn.h"
#include "variant.h"

/**
  A mask is a way to combine two grids of like dimensions such that one grid
  hides values in the other grid.  The value grid is the primary data, and the
  mask grid is used to determine which cells in the value grid should be
  hidden.  If the value in the mask grid falls between MaskMin and MaskMax,
  then the corresponding value in the value grid will be replaced with the
  Replacement value.
*/
typedef struct
{
  Variant MaskMin;
  Variant MaskMax;

  int Negative;           // Indicates if the cells with mask values between 
                          // MaskMin and MaskMax should be shown (0) or hidden (1).

} GridMaskDef;

EXPORT int ParseGridMaskDef(xmlNodePtr root, GridMaskDef* mask);

EXPORT int SaveGridMaskDef(GridMaskDef mask, xmlNodePtr* root);

#endif